package com.yc.weixin.manager;

import java.util.ArrayList;
import java.util.List;

import com.yc.weixin.bean.menu.Button;
import com.yc.weixin.bean.menu.ComplexButton;
import com.yc.weixin.bean.menu.Menu;
import com.yc.weixin.bean.menu.ViewButton;
import com.yc.weixin.util.WeiXinConstants;
import com.yc.weixin.util.WeixinbasicKey;
/**
 * 菜单处理的业务类
 * @author :shuang
 *
 */
public class MenuManager {
	
	//TODO:切换成数据库维护所有的菜单:微信菜单一级最多三个，二级最多五个. 
	/**
	 * 
	 * @return
	 */
	public static Menu getMenu(){
		String click=WeiXinConstants.MENU_TYPE_CLICKBUTTON;
		/**这样定义的菜单就是点击跳转到我们自己开发的网页*/
		String view=WeiXinConstants.MENU_TYPE_VIEWBUTTON;
		//第1个按钮
		ViewButton btn0=new ViewButton("职校微网",view,WeixinbasicKey.SERVERURL+WeixinbasicKey.APPNAME+"/weixin/front/index.jsp");
		//第2个按钮
		ViewButton btn1=new ViewButton("德育经纬",view,WeixinbasicKey.SERVERURL+WeixinbasicKey.APPNAME+"/weixin/front/dyjw.jsp");
		ViewButton btn2=new ViewButton("校园风光",view,WeixinbasicKey.SERVERURL+WeixinbasicKey.APPNAME+"/weixin/front/xyfg.jsp");
		ViewButton btn3=new ViewButton("师生风采",view,WeixinbasicKey.SERVERURL+WeixinbasicKey.APPNAME+"/weixin/front/ssfc.jsp");
		ViewButton btn4=new ViewButton("领导关怀",view,WeixinbasicKey.SERVERURL+WeixinbasicKey.APPNAME+"/weixin/front/ldgh.jsp");
		ViewButton btn5=new ViewButton("新闻中心",view,WeixinbasicKey.SERVERURL+WeixinbasicKey.APPNAME+"/weixin/front/xwzx.jsp");
		
		List<Button> list2=new ArrayList<Button>();
		list2.add(btn1);
		list2.add(btn2);
		list2.add(btn3);
		list2.add(btn4);
		list2.add(btn5);
		
		ComplexButton cb2=new ComplexButton("精彩职校", list2);
		//第3个按钮
		ViewButton btn6=new ViewButton("招生简章",view,WeixinbasicKey.SERVERURL+WeixinbasicKey.APPNAME+"/weixin/front/zsjz.jsp");
		ViewButton btn7=new ViewButton("专业介绍",view,WeixinbasicKey.SERVERURL+WeixinbasicKey.APPNAME+"/weixin/front/zyjs.jsp");
		ViewButton btn8=new ViewButton("招生政策",view,WeixinbasicKey.SERVERURL+WeixinbasicKey.APPNAME+"/weixin/front/zszc.jsp");
		ViewButton btn9=new ViewButton("招生热线",view,WeixinbasicKey.SERVERURL+WeixinbasicKey.APPNAME+"/weixin/front/zsrx.jsp");
		ViewButton btn10=new ViewButton("在线报名",view,"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx5c7e7d3b3b7f98a1&redirect_uri="+WeixinbasicKey.SERVERURL+WeixinbasicKey.APPNAME+"/weixin/userCode.do&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect");
		
		
		List<Button> list3=new ArrayList<Button>();
		list3.add(btn6);
		list3.add(btn7);
		list3.add(btn8);
		list3.add(btn9);
		list3.add(btn10);
		
		ComplexButton cb3=new ComplexButton("招生专栏", list3);	
		
		List<Button> list=new ArrayList<Button>();
		list.add(btn0);
		list.add(cb2);
		list.add(cb3);
		Menu menu=new Menu( list);
		
		return menu;
	}
}
